package main

import (
	"fmt"
	"reflect"
	"runtime"
	"math"
)

func eval(a int, b int, op string) int {
	return 1
}

func div(a, b int) (q, r int) {
	q = a / b
	r = a % b
	return q, r
}

func apply(op func(int, int) int, a, b int) int {
	p := reflect.ValueOf(op).Pointer()
	opName := runtime.FuncForPC(p).Name()
	fmt.Printf("Calling function %d with args (%d,%d)", opName, a, b)
	return op(a, b)
}

func swap(a, b *int) {
	*a, *b = *b, *a
}

func pow(a, b int) int {
	return int(math.Pow(float64(a),float64(b)))
}

func main() {
	q, r := div(13, 3)
	fmt.Println(q, r)
	eval(1, 3, "")
	fmt.Println(apply(pow,3,4))
	fmt.Println(apply(func(a int, b int) int {
		return a +b
	},3,4))
	a, b := 3, 4
	swap(&a, &b)
	fmt.Println(a, b)
}
